<?php
namespace  Android\Model;
use Think\Model;

class CollectModel extends Model
{
    //收藏文章
    public function  lst(&$user_id){
        $arr1= $this->alias('co')->join('article ar on co.collect_id=ar.art_id')->field('co.type,co.time,title,content,collect_id')->where('co.user_id='.$user_id." and co.type=2" )->select();
        $arr2=$this->alias(co)->join('website we on co.collect_id=we.id')->field('co.type,time,name,address,collect_id')->where('co.user_id='.$user_id." and co.type=1" )->select();
        $sort_list= array_merge($arr1,$arr2);
        foreach ($sort_list as $user) {
            $time[] = $user['time'];
        }
        array_multisort($time,SORT_DESC,$sort_list);
        return $sort_list;
     }
}